using Grpc.Core;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;

namespace ApiGateway.Controllers
{
    [ApiController]
    [Route("api/[controller]")]
    public class TestController : ControllerBase
    {
        private readonly GrpcProtos.UserService.UserGrpcService.UserGrpcServiceClient _client;
        public TestController(GrpcProtos.UserService.UserGrpcService.UserGrpcServiceClient client)
        {
            _client = client;
        }

        [HttpGet]
        public IActionResult Get()
        { 
            var res = _client.GetUserInfo(new GrpcProtos.UserService.EmptyRequest
            {

            });
            return Ok(res);
        }
    }
}